package com.mz.ieann.aide.base

import android.content.res.Configuration
import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
import com.mz.ieann.dokit.utils.LogUtils
import com.mz.ieann.dokit.utils.ToastUtils

/**
 * <p>------------------------------------------------------
 * <p> Copyright (C) 2021 zhangmz, All rights reserved.
 * <p> If there is technical discussion, you can contact zhangmz90@foxmail.com
 * <p>------------------------------------------------------
 * <p> des
 * <p>
 *
 * @author Created by Administrator
 * @date on 2021 2021/11/14 11:51
 */
open class BaseActivity : AppCompatActivity() {

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
    }

    override fun onConfigurationChanged(newConfig: Configuration) {
        super.onConfigurationChanged(newConfig)
        if(newConfig.orientation == Configuration.ORIENTATION_LANDSCAPE){
            screenHorizontal()
        }else{
            screenVertical()
        }
    }

    /**
     * 横屏切换
     */
    open fun screenHorizontal(){

    }

    /**
     * 竖屏切换
     */
    open fun screenVertical(){

    }

    fun toast(message : String){
        ToastUtils.toast(this, message)
    }

    fun log(message : String){
        LogUtils.v(message)
    }

}